package com.arpa.wms.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.arpa.wms.domain.enums.WmsTaskJobStatusEnum;
import com.arpa.wms.domain.enums.WmsTaskTypeEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 任务中心
 * </p>
 *
 * @author LEO
 * @since 2020-10-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("wms_task")
@ApiModel(value = "Task对象", description = "任务中心")
public class WmsTask extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "关联单号")
    @TableField("source_code")
    private String sourceCode;

    @ApiModelProperty(value = "仓库")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "库位")
    @TableField("location")
    private String location;

    @ApiModelProperty(value = "所属机构Code")
    @TableField("group_code")
    private String groupCode;

    @ApiModelProperty(value = "任务类型：RECEIVE收货、PUTAWAY上架、PICKING拣货、CHECK复核、INVENTORY盘点、MOVE移位")
    @TableField("task_type")
    private WmsTaskTypeEnum taskType;

    @ApiModelProperty(value = "商品种数")
    @TableField("goods_type_quantity")
    private Integer goodsTypeQuantity;

    @ApiModelProperty(value = "商品件数")
    @TableField("goods_quantity")
    private BigDecimal  goodsQuantity;

    @ApiModelProperty(value = "作业数量")
    @TableField("job_quantity")
    private BigDecimal  jobQuantity;

    @ApiModelProperty(value = "作业人姓名")
    @TableField("operator_name")
    private String operatorName;

    @ApiModelProperty(value = "作业人")
    @TableField("operator_by")
    private String operatorBy;

    @ApiModelProperty(value = "指派人姓名")
    @TableField("assign_name")
    private String assignName;

    @ApiModelProperty(value = "指派人")
    @TableField("assign_by")
    private String assignBy;

    @ApiModelProperty(hidden = true,value = "指派时间")
    @TableField(value = "gmt_assign")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtAssign;

    @ApiModelProperty(value = "状态:WAITING（待作业），WORKING（作业中），COMPLETED（作业完成）")
    @TableField("job_status")
    private WmsTaskJobStatusEnum jobStatus;


    @ApiModelProperty(hidden = true,value = "指派状态：0未指派，1已指派")
    @TableField(value = "is_assign")
    private Integer assign;

    @ApiModelProperty(hidden = true, value = "是否有容器: 0 无容器，普通上架；1 有容器，托盘上架")
    @TableField("is_container")
    private Integer container;

    @ApiModelProperty(value = "订单标识 1-单品单件 2-单品多件 3-多品 4-爆品 5-按单")
    @TableField("order_tag")
    private String orderTag;

    /**
     * 是否预打包拣货单:0否1是
     */
    @ApiModelProperty(value = "是否预打包拣货单:0否1是")
    @TableField("is_prepackaged")
    private Integer prepackaged;



}
